package com.example.demo.object;

import com.fasterxml.jackson.databind.util.BeanUtil;
import org.springframework.beans.BeanUtils;

public class ObjectTest {
    public static void main(String[] args) {
        //
        One one = new One(1);
        Two two = new Two();
        BeanUtils.copyProperties(one,two);
        System.out.println(two.toString());
        //BeanUtils.copyProperties 是浅拷贝
        One one1 = new One();
        Two two1 = new Two(2,"崔鹏");
        BeanUtils.copyProperties(two1,one1);
        // object 原始数据， object2 接受数据
        System.out.println(one1.toString());
    }
}
